import * as TYPES from "../action-types"
import { fetchFileInfoApi, fetchFunsByFileId } from '../../api/projectConfig'


let controller = {

    fetchFileInfo(fileId) {
        return async dispatch=>{
            let result = await fetchFileInfoApi(fileId)
            dispatch({
                type:TYPES.CONFIG_PROJECT_FETCH_FILE_INFO,
                result
            })
        }
    },

    fetchFunsByFileId(fileId) {
        return async dispatch=>{
            let result = await fetchFunsByFileId(fileId)
            dispatch({
                type:TYPES.CONFIG_PROJECT_FETCH_FILE_FUNS,
                result
            })
        }
    },


}

export default controller